home *** CD-ROM | disk | FTP | other *** search
- <?php
- include("fn.php");
- $pass="";
- if (isset($_POST["Password"]))
- $pass=md5(charEncode($_POST["Password"]));
- include("getpass.php");
-
- $report=<<<ENDH
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <title>Chyba</title>
- </head>
- <body>
- <br>
- %message%<br>
- <a href="admin.php">Zp─¢t</a>
- </body>
- </html>
- ENDH;
-
- if (isset($_GET['COOKIE_SET']))
- {
- $lpass="";
- if (isset($_COOKIE['zpsgallery']))
- $lpass=$_COOKIE['zpsgallery'];
- if (!passwordvalid($lpass))
- {
- $report=str_replace("%message%","Nepodařilo se vytvořit cookie",$report);
- echo $report;
- }
- else
- {
- echo "<meta http-equiv=\"refresh\" content=\"0; url=admin.php\">";
- }
- }
- else
- {
- if (!passwordvalid($pass))
- {
- $report=str_replace("%message%","Zadané heslo je neplatné",$report);
- echo $report;
- }
- else
- {
- if (!setcookie("zpsgallery",$pass, time()+3600))
- {
- $report=str_replace("%message%","Nepodařilo se vytvořit cookie",$report);
- echo $report;
- }
- else
- {
- header("Location: $PHP_SELF?COOKIE_SET=1") ;
- }
- }
- }
- ?>
-